package com.sss.day35_mvc_mybatis.service.Impl;

import com.sss.day35_mvc_mybatis.model.User;
import com.sss.day35_mvc_mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sss.day35_mvc_mybatis.mapper.UserMapper;

import java.util.HashMap;
import java.util.List;

/**
 * 全世界我最爱朴彩英！
 *
 * @Author sss
 * @Create 2023/11/27 17:49
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper mapper;

    public User findUserById(int id) {

        return mapper.findUserById(id);
    }

    public List<User> findAll() {
        return mapper.findAll();
    }

    public User findByLogin(String username, String password) {
        return mapper.findByLogin(username,password);
    }

    public User findUserByLoginMap(HashMap<String,Object> map) {
        return mapper.findUserByLoginMap(map);
    }

    public int addUser(User user) {
        return mapper.addUser(user);
    }


}
